home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / n_b_v203.zip / TPRNTMID.DMO < prev    next >
Text File  |  1996-07-04  |  3KB  |  45 lines

  1. $if 0
  2.     ┌──────────────────────────╖                        PowerBASIC v3.20
  3.  ┌──┤          DASoft          ╟──────────────────────┬──────────────────╖
  4.  │  ├──────────────────────────╢    Copyright 1995    │ DATE: 1995-10-01 ╟─╖
  5.  │  │ FILE NAME   TPRNTMID.DMO ║          by          ╘════════════════─ ║ ║
  6.  │  │                          ║  Don Schullian, Jr.                     ║ ║
  7.  │  ╘══════════════════════════╝                                         ║ ║
  8.  │ A license is hereby granted to the holder to use this source code in  ║ ║
  9.  │ any program, commercial or otherwise,  without receiving the express  ║ ║
  10.  │ permission of the copyright holder and without paying any royalties,  ║ ║
  11.  │ as long as this code is not distributed in any compilable format.     ║ ║
  12.  │  IE: source code files, PowerBASIC Unit files, and printed listings   ║ ║
  13.  ╘═╤═════════════════════════════════════════════════════════════════════╝ ║
  14.    │                ....................................                   ║
  15.    ╘═══════════════════════════════════════════════════════════════════════╝
  16. $endif
  17.  
  18. $INCLUDE "DAS-NBT1.INC"
  19. COLOR 7, 0
  20. CLS
  21. ? "┌──────────────────────────────────────────────────────────────────────────
  22. ? "│  TprintMid    ( Row?, Col?, V$, MidPos%, Chars%, Attr? )
  23. ? "│ fTprintMid??  ( Row?, Col?, V$, MidPos%, Chars%, Attr? )
  24. ? "│  TprintMid2   ( Row?, Col?, V$, MidPos%, Mpos2%, Attr? )
  25. ? "│ fTprintMid2?? ( Row?, Col?, V$, MidPos%, Mpos2%, Attr? )
  26. ? "├──────────────────────────────────────────────────────────────────────────
  27. ? "│ TprintMid works like PowerBASIC's MID$ function while TprintMid2 works on
  28. ? "│ position to position.
  29. ? "│ The functions return the ROWCOL of the end of the printed text(s).
  30. ? "└──────────────────────────────────────────────────────────────────────────
  31.  
  32. Test$ = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"                   ' test string
  33.                                                        '
  34. Tprint 12, 1, "The test string: " + Test$, 9         '
  35. Tprint 14, 1, "TprintMid (14,25,T$,5,10,14) =", 7      '
  36. TprintMid  14, 32, Test$, 5, 10, 14                    ' 10 characters
  37.                                                        '
  38. Tprint 16, 1, "TprintMid2(16,25,T$,5,10,14) = ", 7     '
  39. RowCol?? = fTprintMid2??( 16, 32, Test$, 5, 10, 14 )   ' 6 characters
  40.                                                        '
  41. Row? = ( RowCol??  \  256 )                            '
  42. Col? = ( RowCol?? MOD 256 )                            '
  43. LOCATE Row?, Col?, 1, 15, 16                           '
  44. Tprint Row?, Col?, "  the cursor is here.", 139      ' blink = Attr? + 128 )
  45.                     ' └─────────────────────────────>    change attribute